package buslogic;

import myutils.MessageHelper;

public class ModelValidator {

    private String validationErrors;

    public void validateModel(ModelContainer mc) {

        validationErrors = "";
        MessageHelper mh = new MessageHelper();

        //validate the model
        if (mc.x1 < 0.0) {
            mh.addMessage("Validation Error: x1=" + mc.x1 + " should not be < 0.0!");
        }
        if (mc.x2 > 5.0) {
            mh.addMessage("Validation Error: x2=" + mc.x2 + " should not be > 5.0!");
        }

        validationErrors = mh.getCompleteMessage();

    }

    public String getValidationErrors() {
        return validationErrors;
    }

}
